[power@cinnamon.org] Add support for more battery device labels and icons #12262
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have a device that shows up in UPower as a
HEADSET
, which wasn't one of the enumerated device types in the power applet so it showed up as "Unknown" with a generic battery icon. When I went to add support for the headset, I noticed this comment:cinnamon/files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js
Line 16 in 8d97e56
So instead of adding only the
HEADSET
device type, I've addedUPowerGlib
introspection and usedUPDevice.kind_to_string(kind)
so now any device type should get a reasonable label. I've also added icons for several more device types.I've also renamed a few variables to be consistent with the
DeviceKind
terminology used byUPowerGlib
(instead ofDeviceType
)